/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _OLA_PAL_RANDOM_H_
#define _OLA_PAL_RANDOM_H_

#ifdef __cplusplus
extern "C" {
#endif

/*
 * 功能: 真随机数生成(true random number generator)
 * 参数: (1) input，出入参，随机数缓冲区
 *       (2) len，随机数字节长度
 * 返回: 0，获取成功
 *       -1，获取失败或不支持真随机数
 * 注意: 对于不具备真随机数或硬件随机数能力的设备该接口返回-1，sdk内部会使用基于mbedtls的伪随机数
 */
int OlaTrng(unsigned char *input, unsigned int len);

#ifdef __cplusplus
}
#endif

#endif /* _OLA_PAL_RANDOM_H_ */